<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>添加员工信息</title>
<!-- Bootstrap core CSS -->
<link href="${basePath}bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<!-- Optional Bootstrap Theme -->
<link href="data:text/css;charset=utf-8,"
	data-href="${basePath}bootstrap-3.3.7-dist/css/bootstrap-theme.min.css"
	rel="stylesheet" id="bs-theme-stylesheet">
<!-- bootstrap-datetimepicker -->
<script src="${basePath}jquery-1.11.3/jquery.min.js"></script>

<link
	href="${basePath}bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"
	rel="stylesheet" />
<script
	src="${basePath}bootstrap-datetimepicker/js/moment-with-locales.min.js"></script>
<script
	src="${basePath}bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>

<!-- Bootstrap core JavaScript
		<!-- Placed at the end of the document so the pages load faster -->
<script src="${basePath}bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function() {		
		 $('#datetimepicker1').datetimepicker({  
		        format: 'YYYY-MM-DD hh:mm:ss',  
		        locale: moment.locale('zh-cn')  
		    });
		 //dom初始化时直接加载
		 doJqueryAjax();
	});
		 //使用ajax获取修改数据的相关信息
		 function doJqueryAjax() {
			 //url
			 var url="${basePath}EmployeeInfoModalModifySearchServlet?sid=${sessionScope.sid}";
			 $.getJSON(url,function(data){
				 //解析数据
				 if(data){
					 //将查询到的数据给控件进行赋值处理
					 $("#emp_id").val(data.emp_id);
					 $("#emp_name").val(data.emp_name);
					 $("#emp_date").val(data.emp_date);
					 $("#emp_age").val(data.emp_age);
					 $("#emp_tel").val(data.emp_tel);
					 $("#emp_ad").val(data.emp_ad);
					 $("input[value='"+data.emp_sex+"']").attr("checked","checked");

		}
	});
 }
</script>
</head>

<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-12">
				<div class="row">
					<div class="col-md-3"></div>
					<div class="col-md-6">
						<form class="form-horizontal" id="formMod"
							action="${basePath}EmployeeInfoServlet" method="post" enctype="multipart/form-data">
							<div class="form-group"></div>
							<!-- 将主键字段ID值返回到数据库 -->
							<input type="hidden" id="emp_id"
										name="emp_id"  >
							<div class="form-group">
								<label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
								<div class="col-sm-4">
								<!-- readonly :页面不可编辑但可以提交表单
								     disabled :页面不可编辑但不可以提交表单 -->
									<input type="text" readonly class="form-control" id="emp_name"
										name="emp_name"  placeholder="请输入学生姓名">
								</div>

								<label for="inputEmail3" class="col-sm-2 control-label">性别</label>
								<div class="col-sm-4">
									<label class="radio-inline"> <input type="radio"
										id="emp_sex" name="emp_sex" value="女" >女
																		
										</label> <label class="radio-inline"> <input type="radio"
										id="emp_sex" name="emp_sex" value="男"> 男
									</label>
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">出生日期</label>
								<div class="col-sm-4">
									<!-- <input type="text" class="form-control" id="emp_date"
										name="emp_date" placeholder="请选择出生日期"> -->
									<div class='input-group date' id='datetimepicker1'>
										<input type='text' class="form-control" id="emp_date"
											name="emp_date"/> <span class="input-group-addon">
											<span class="glyphicon glyphicon-calendar"></span>
										</span>
									</div>
								</div>
								<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">年龄</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="emp_age"
										name="emp_age" placeholder="请输入年龄">
								</div>
							</div>
								<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">电话</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="emp_tel"
										name="emp_tel"  placeholder="请输入电话">
								</div>
							</div>

								<label for="inputPassword3" class="col-sm-2 control-label">地址</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="emp_ad"
										name="emp_ad"  placeholder="请输入地址">
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label">头像</label>
								<div class="col-sm-4">
									<input type="file" class="form-control" id="emp_img"
										name="emp_img">
								</div>
							</div>
						</form>
					</div>
					<div class="col-md-3"></div>
				</div>
			</div>
		</div>
	</div>

</body>

</html>